home *** CD-ROM | disk | FTP | other *** search
/ Cubase Magazine 5 / Issue #05.iso / 2-SOFTWARE / 2-SHAREWARE / WINAMP / WINAMP202.EXE / FRONTEND.TXT < prev    next >
Text File  |  1998-09-29  |  6KB  |  165 lines

  1. #define WM_WA_IPC WM_USER
  2. // messages are sent to the winamp window using:
  3. //result = SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command);
  4.  
  5.  
  6. /* Messages available to send */
  7.  
  8. #define IPC_GETVERSION 0
  9. /*
  10.     IPC_GETVERSION is sent to the window, and the return value is the version
  11.         Version 1.55 = 0x1551
  12.         Version 1.6b = 0x16A0
  13.         Version 1.60 = 0x16AF
  14.         Version 1.61 = 0x16B0
  15.         Version 1.62 = 0x16B1
  16.         Version 1.64 = 0x16B3
  17.         Version 1.666 = 0x16B4
  18.         Version 1.69 = 0x16B5
  19.         Version 1.70 = 0x1700
  20.         Version 1.72 = 0x1702
  21.         Version 1.73 = 0x1703
  22.         Version 1.80 = 0x1800
  23.         Version 1.81 = 0x1801
  24.         Version 1.82 = 0x1802
  25.         Version 1.90 = 0x1900
  26.         Version 1.91 = 0x1901
  27.                 Version 2.00 = 0x2000
  28.                 Version 2.01 = 0x2001
  29.                 Version 2.02 = 0x2002
  30.     the command_data parameter is 0.
  31.     so, 
  32.     if (SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) != 0x1551)
  33.         MessageBox(NULL,"Error, Winamp 1.55 not found","Warning",MB_OK);
  34. */
  35.  
  36.  
  37. #define IPC_PLAYFILE 100
  38. /*
  39.     IPC_PLAYFILE is sent to the window for each char of a null terminated string of a file to ADD
  40.     to the playlist (it doesn't change the playing status). Note, if you pass a file with the extension
  41.     ".m3u" it will be treated as a playlist.
  42.     for example:
  43.         char *file = "C:\\download\\booga.mp3";
  44.         int x;
  45.         for (x = 0; x <= strlen(file); x ++)
  46.             PostMessage(hwnd_winamp,WM_WA_IPC,(LPARAM)file[x],IPC_PLAYFILE);
  47.     will add "C:\download\booga.mp3" to the end of the playlist
  48. */
  49.  
  50. #define IPC_DELETE 101
  51. /* 
  52.     IPC_DELETE deletes the internal Winamp playlist.
  53.         SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
  54. */
  55.  
  56. #define IPC_STARTPLAY 102
  57. /* 
  58.     IPC_STARTPLAY starts the playing.
  59.         SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
  60. */
  61.  
  62. #define IPC_CHDIR 103
  63. /*
  64.     IPC_CHDIR is sent to the window for each char of a null terminated string of a directory to change to
  65.     for example:
  66.         char *dir = "C:\\Download";
  67.         int x;
  68.         for (x = 0; x <= strlen(file); x ++)
  69.             PostMessage(hwnd_winamp,WM_WA_IPC,(LPARAM)dir[x],IPC_PLAYFILE);
  70.     will change the winamp process to "C:\download" (useful for relative pathnames and loading playlists)
  71.  
  72. */
  73. #define IPC_ISPLAYING 104
  74. /*
  75.     IPC_ISPLAYING returns the status of playback.
  76.     If it returns 1, it is playing. if it returns 3, it is paused, if it returns 0, it is not playing.
  77.     If it returns something other than 1,3,or 0, something is screwed.
  78.     isplaying = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
  79. */
  80.  
  81.  
  82. #define IPC_GETOUTPUTTIME 105
  83. /*
  84.     IPC_GETOUTPUTTIME returns the position in milliseconds of the 
  85.           current song (lParam = 0), or the song length, in seconds (lParam = 1).
  86.     Returns -1 if not playing or error.
  87.         
  88.     song_pos = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME);
  89.     song_len = SendMessage(hwnd_winamp,WM_WA_IPC,1,IPC_GETOUTPUTTIME);
  90. */
  91.  
  92. #define IPC_JUMPTOTIME 106
  93. /*
  94.         *ONLY AVAILABLE IN v1.60+*
  95.     IPC_JUMPTOTIME sets the position in milliseconds of the current song (approximately)
  96.     Returns -1 if not playing, 1 on eof, or 0 if successful
  97.     SendMessage(hwnd_winamp,WM_WA_IPC,new_song_pos,IPC_JUMPTOTIME);
  98. */
  99. #define IPC_WRITEPLAYLIST 120
  100. /*
  101.         *ONLY AVAILABLE IN v1.666+*
  102.     IPC_WRITEPLAYLIST writes the current playlist to <winampdir>\\Winamp.pl
  103.     int cursong =  SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
  104.     (cursong is the index of the current song in the playlist)
  105. */
  106.  
  107. // winamp 2.0+ (pre2 0902+)
  108. #define IPC_SETPLAYLISTPOS 121
  109. /* 2.0 + ... wParam == playlist position */
  110.  
  111. #define IPC_SETVOLUME 122
  112. /* 2.0 + ... wParam == volume 0-255 */
  113. #define IPC_SETPANNING 123
  114. /* 2.0 + ... wParam == pannign 0-255 */
  115. #define IPC_GETLISTLENGTH 124
  116. /* 2.0 + ... returns playlist lenght in tracks */
  117.  
  118.  
  119. // THESE MIGHT CHANGE in the future :)
  120. //Also, you can send standard WM_COMMAND messages to the Winamp window (for other controls), including
  121. // Send using SendMessage(hwnd_winamp,WM_COMMAND,WINAMP_OPTIONS_EQ/*orwhatever*/,0);
  122.  
  123. // toggles the EQ window
  124. #define WINAMP_OPTIONS_EQ               40036
  125. // toggles the playlist window
  126. #define WINAMP_OPTIONS_PLEDIT           40040
  127. // turns the volume up a little
  128. #define WINAMP_VOLUMEUP                 40058
  129. // turns the volume down a little
  130. #define WINAMP_VOLUMEDOWN               40059
  131. // fast forwards 5 seconds
  132. #define WINAMP_FFWD5S                   40060
  133. // rewinds 5 seconds
  134. #define WINAMP_REW5S                    40061
  135. // the following are the five main control buttons, with optionally shift or control pressed
  136. // (for the exact functions of each, just try it out)
  137. #define WINAMP_BUTTON1                  40044
  138. #define WINAMP_BUTTON2                  40045
  139. #define WINAMP_BUTTON3                  40046
  140. #define WINAMP_BUTTON4                  40047
  141. #define WINAMP_BUTTON5                  40048
  142. #define WINAMP_BUTTON1_SHIFT            40144
  143. #define WINAMP_BUTTON2_SHIFT            40145
  144. #define WINAMP_BUTTON3_SHIFT            40146
  145. #define WINAMP_BUTTON4_SHIFT            40147
  146. #define WINAMP_BUTTON5_SHIFT            40148
  147. #define WINAMP_BUTTON1_CTRL             40154
  148. #define WINAMP_BUTTON2_CTRL             40155
  149. #define WINAMP_BUTTON3_CTRL             40156
  150. #define WINAMP_BUTTON4_CTRL             40157
  151. #define WINAMP_BUTTON5_CTRL             40158
  152.  
  153. // always goes to the previous song (unlike button 1), 1.666+
  154. #define WINAMP_PREVSONG                    40198
  155.  
  156. // pops up the load file(s) box
  157. #define WINAMP_FILE_PLAY                40029
  158. // pops up the preferences
  159. #define WINAMP_OPTIONS_PREFS            40012
  160. // toggles always on top
  161. #define WINAMP_OPTIONS_AOT              40019
  162. // pops up the about box :)
  163. #define WINAMP_HELP_ABOUT               40041
  164.  
  165.